<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload=function(){

            var canvas=document.getElementById("canvas");
            var cx = canvas.getContext("2d"); 
            cx.translate(240,120);
            cx.fillStyle = "rgba(0,0,250,0.25)";
            //画90个矩阵
            for(var i=0;i<90;i++) {
                cx.scale(0.95,0.95);//下一个矩阵长和宽都缩小0.95倍
                cx.rotate(Math.PI/9);
                cx.translate(24,12);
                cx.fillRect(80,0,100,50);
            }




        }
    </script>
</head>
<body>
    <canvas id="canvas" width="600px" height="600px" style="background:cornsilk"></canvas>
</body>
</html>